package com.example.sdemo.api.controller;

import com.example.sdemo.app.service.StudentService;
import com.example.sdemo.app.service.TeacherService;
import com.example.sdemo.domain.entity.Student;
import com.example.sdemo.domain.entity.Teacher;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Resource
    TeacherService teacherService;

    @PostMapping("/addT")
    public Boolean addT(@RequestBody Teacher teacher){
        return teacherService.insertT(teacher);
    }
    @PostMapping("/deleteT/{id}")
    public Boolean delT(@PathVariable Integer id){
        return teacherService.deleteT(id);
    }
    @PostMapping("/updateT")
    public Boolean updateT(@RequestBody Teacher teacher){
        return teacherService.updateT(teacher);
    }
    @PostMapping("/findT/{id}")
    public String findT(@PathVariable Integer id){
        return teacherService.selectTById(id).toString();
    }


}
